package algorithm.sort;

/**
 * 冒泡
 */
public class Bubbling {
    public static void main(String[] args) {
       int [] ay = {2,34,-1,23,1,23};

       for(int j = ay.length; j > 0; j--){
           for(int i = 1; i < j; i++){
               if(ay[i-1] > ay[i]){
                   int tmp = ay[i-1];
                   ay[i-1] = ay[i];
                   ay[i] = tmp;
               }
           }
       }

       for (int i : ay){
           System.out.println(i);
       }
    }

}
